package com.newsproject.service;

import com.newsproject.pojo.*;
import com.newsproject.pojo.DTO.UpdatePost;
import com.newsproject.pojo.vo.PublishPost;
import com.newsproject.pojo.vo.CommentVo;

import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Map;

public interface PostService {

    Result<Object> insertComment(String content,int parentId, HttpSession session);
    Result<Object> deleteComment(int commentId,HttpSession session);
    Result<Object> insertLike(int commentid,HttpSession session);
    Result<Integer> intserHeart( int postId,HttpSession session);
    Result<Object> intserbookmark(int postId,HttpSession session);
    Result<Object> follower(int followedId,HttpSession session);
    Result<Object> sharePost(int postId,int forwardedId,HttpSession session);
    //获取粉丝列表
    Result<Map<String,Object>> followerList(Integer pageNum,HttpSession session);
    //获取关注列表
    Result<Map<String,Object>> followedList(Integer pageNum,HttpSession session);
    //统计粉丝总数
    Result<Object> countfollower(HttpSession session);
    //统计关注总数
    Result<Object> countfollowed(HttpSession session);
    // 获取帖子下的所有评论及回复
     Result<Map<String,Object>> getCommentsWithReplies(Integer postId);
    //统计用户的获赞总数
    Integer countAlllike(Integer userId);
    //查询用户点赞过的新闻
    Result<List<Post>> HeartList(HttpSession session);
    //查询用户收藏的新闻资讯
    Result<List<Post>> BookmarkList(HttpSession session);
    Result<Object> getCurrentUrl(HttpServletRequest request);
    //判断用户评论点赞及是否有回复的状态
    Result<Map<String,Object>> commentstatus(int commentId,HttpSession session);
    void searchAndStoreHotPost();


    //查询评论
    Result<Map<String,Object>> getAllCommentByPage(Integer postId,Integer pageNum);

    //删除评论
    void deleteComment(Integer commentId);
    //根据postId删除post
    String deletePost(Integer postId);

   //根据标签查询post用于页面展示
    ModelAndView getPostByPageAndTagId(Integer pageNum,Integer pageSize,Integer tagId,HttpSession session);
    Result<Map<String ,Object>> findPostByPageAndTagId(Integer pageNum,Integer pageSize,Integer tagId);
    ModelAndView getEssayPage(Integer postId ,HttpSession session);

    Result<Map<String ,Object>> getFollowerPost(HttpSession session, int start , int pageSize);
    Result<Object> post(PublishPost post,MultipartFile coverImage,MultipartFile image,HttpSession session) throws Exception;

    Result<Map<String,Object>> comment(String content, Integer postId, HttpSession session);
    Result<Map<String,Object>> getSomeStatus(Integer postId,HttpSession session);
    Result<List<CommentVo>> getAllComment(Integer postId);
    Result<Object> updatePost(PublishPost post,MultipartFile coverImage,MultipartFile image,Integer postId) throws Exception;

    ModelAndView redirectToCreator(HttpSession session);
    Result<UpdatePost> getPostById(Integer postId);

    Result<Map<String,Object>> findPost(Integer pageNum,Integer userId, Integer categoryId,Integer auditStatus , Integer textStatus,HttpSession session);


    Result<Map<String,Object>> deleteAndJudge(Integer postId,HttpSession session);
}